home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 5
/
Gold Medal Software - Volume 5 (Gold Medal) (1995).iso
/
windows
/
win31
/
cenviw.arj
/
WINEXECS.CMM
< prev
next >
Wrap
Text File
|
1994-03-08
|
1KB
|
29 lines
/*************************************************************
*** WinExecs - Sample Cmm code to demonstrate uses of the ***
*** ver.1 WinExec() function. ***
*************************************************************/
#include <WinExec.lib>
#include <MsgBox.lib>
MessageBox("The following samples show various ways\n"
"to use the Windows WinExec() function.\n"
"A wrapper for WinExec() is located in\n"
"the Cmm library: \"WinExec.lib\"",
"WinExecs - Welcome!");
MessageBox("Will now start up NotePad with the C:\\Autoexec.bat file","");
result = WinExec("NotePad.exe c:\\AutoExec.bat");
if ( result < 32 ) WinExecError(result);
MessageBox("Now start the File Manager minimized","");
result = WinExec("WinFile.exe",SW_SHOWMINIMIZED);
if ( result < 32 ) WinExecError(result);
WinExecError(ErrorNumber)
{
sprintf(ErrorMessage,"That call to WinExec returned error: %d",ErrorNumber);
MessageBox(ErrorMessage);
}